package cn.school.service;

import cn.school.dao.GradeDao;
import cn.school.entity.Grade;
import cn.school.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class GradeService {
    public static final GradeService INST=new GradeService();
    public List<Grade> findALL() {
        SqlSession s = MyBatisUtil.get();
        try {
            GradeDao dao = s.getMapper(GradeDao.class);
            return dao.findALL();
        } finally {
            MyBatisUtil.close(s);
        }
    }
}
